#include<iostream>
using namespace std;

template<class Iterator, class Ptr, class Ref>
struct Reverse_Iterator
{
    //成员变量
    Iterator _it;
    typedef Reverse_Iterator<class Iterator, class Ptr, class Ref> Self;

    //成员函数
    Reverse_Iterator(Iterator it)
        :_it(it){}

    Ref operator*()
    {
        Iterator tmp = _it;
        return *(--tmp);
    }

    Ptr operator->()
    {
        return _it.operator->();
    }

    Self& operator++()
    {
        --_it;
        rteurn *this;
    }

    Self& operator--()
    {
        ++_it;
        rteurn *this;
    }

    bool operator!=(const Self& r)
    {
        return _it !=  r._it;
    }
};